//
//  LXListTableViewCell.m
//  喜马拉雅改良版框架
//
//  Created by liuxin on 15/12/22.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "LXListTableViewCell.h"

@implementation LXListTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}
-(void)createSubViews{
    self.imageV = [[UIImageView alloc]init];
    [self.contentView addSubview:_imageV];
    [_imageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.mas_equalTo(5);
        make.bottom.mas_equalTo(-5);
        make.width.mas_equalTo(70);
    }];
    
    self.titleLabel = [[UILabel alloc]init];
    [self.contentView addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_imageV.mas_right).offset(5);
        make.top.mas_equalTo(5);
        make.height.mas_equalTo(25);
        make.right.mas_equalTo(-5);
    }];
    
    self.oneLabel = [[UILabel alloc]init];
    self.oneLabel.textColor = [UIColor grayColor];
    self.oneLabel.font = [UIFont systemFontOfSize:15];
    [self.contentView addSubview:_oneLabel];
    [_oneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_imageV.mas_right).offset(5);
        make.top.mas_equalTo(_titleLabel.mas_bottom).offset(5);
        make.height.mas_equalTo(20);
        make.right.mas_equalTo(-5);
    }];
    
    self.twoLabel = [[UILabel alloc]init];
    self.twoLabel.textColor = [UIColor grayColor];
    self.twoLabel.font = [UIFont systemFontOfSize:15];
    [self.contentView addSubview:_twoLabel];
    [_twoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_imageV.mas_right).offset(5);
        make.top.mas_equalTo(_oneLabel.mas_bottom).offset(5);
        make.height.mas_equalTo(20);
        make.right.mas_equalTo(-5);
    }];
}
-(void)setCellModel:(LXListDetai *)cellModel{
    [_imageV sd_setImageWithURL:[NSURL URLWithString:cellModel.coverPath] placeholderImage:[UIImage imageNamed:ImagePlaceHolder]];
    _titleLabel.text = cellModel.title;
    _oneLabel.text = [NSString stringWithFormat:@"1  %@",cellModel.firstTitle];
    _twoLabel.text =[NSString stringWithFormat:@"2  %@",[cellModel.firstKResults[1]title]];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
